﻿<%@ Page Title="" Language="C#" MasterPageFile="~/manager/page/ManagerMasterPage.Master" AutoEventWireup="true" CodeBehind="recruit.aspx.cs" Inherits="Com.Web.coffinegurunaru.manager.recruit.recruit" %>
<%@ Register TagPrefix="UC" TagName="Menu" Src="~/manager/recruit/menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phHead" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phContent" runat="server">
<hr />
<br />
<table width="100%" border="0">
<tr>
	<td valign="top" width="60">
		<UC:Menu ID="Menu1" SubPageType=1 runat="server" />
	</td>
	<td style="width:20px;"></td>
	<td valign="top">
		<table cellpadding="0" cellspacing="1" style="background-color:Gray; width:100%;">
		<tr>
			<td style="background-color:#eeeeee; text-align:center; height:30px; width:100px; text-align:center;">상태 검색</td>
			<td style="background-color:White; text-align:center; text-align:left;">
				<select id="m_Status">
					<option value="0">전체</option>
					<option value="1">등록</option>
					<option value="2">합격</option>
					<option value="3">진행</option>
					<option value="4">불합격</option>
				</select>
			</td>
		</tr>
		<tr>
			<td style="background-color:#eeeeee; text-align:center; height:30px; text-align:center;">희망업무형태</td>
			<td style="background-color:White; text-align:center; text-align:left;">
				<select id="m_JobTime">
					<option value="0">전체</option>
					<option value="1">정직원</option>
					<option value="2">Part Time</option>
				</select>
			</td>
		</tr>
		</table>
		<br />
		<table width="100%">
		<tr>
			<td style="text-align:center; width:500px;" valign="top">
				<div id="m_List"></div>
				<br />
				<div id="m_Pager"></div>			
			</td>
			<td style="width:10px">&nbsp;"
			</td>
			<td valign="top">
				<div id="m_Info"></div>
			</td>
		</tr>
		</table>
	</td>
</tr>
</table>
<script language="javascript" type="text/javascript">
(function($) {
	$.Recruit = {};
	
	$.Recruit = {
		Status : 0,
		JobTime : 0,

		Init : function() {
			$("#m_Pager").pager({
				pageSize : 30,
				useCallback : true,
				currentPageNo : 1,
				callback:function(pageNo) {
					$.Recruit.GetList();
				}
			});
			
			$("#m_Status").change(function() {
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Recruit.GetList();
			});
			
			$("#m_JobTime").change(function() {
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Recruit.GetList();
			});
			
			$.Recruit.GetList();
		},
		
		GetList : function() {
			var Status = $("#m_Status").val();
			var JobTime = $("#m_JobTime").val();

			$("#m_List").ajaxNet(
			"/manager/recruit/recruitMethod.aspx?_vb=GetList"
			,
			{
				"Status" : Status
			,	"JobTime" : JobTime
			,	"PageNo" : $("#m_Pager").pager("option", "currentPageNo")
			,	"PageSize" : $("#m_Pager").pager("option", "pageSize")
			}, function(results, context)
			{
				$("#m_List").html( results[ 0 ] );
				$("#m_List").find("input.m_btnInfo").click(function() {
					var $tr = $(this).closest("tr");
					var data = $tr.tagdata();
					
					$.Recruit.GetInfo(data.RecruitNo);
				});
				$("#m_Pager").pager("update", results[1]);
			});
		},
		
		GetInfo : function( RecruitNo ) {
			$("#m_Info").ajaxNet(
			"/manager/recruit/recruitMethod.aspx?_vb=GetInfo"
			,
			{
				"RecruitNo" : RecruitNo
			}, function(results, context)
			{
				$("#m_Info").html( results );
				
				$("#m_Info").find( "input.m_Modify" ).click(function() {
					$.Recruit.Modify();
					return false;
				});
			});
		},
		
		Modify : function() {
			var $tbl = $("#m_Info").find("table.m_RecruitInfo");
			var data = $tbl.tagdata();
			var Status = $tbl.find("select.m_Status").val();
			var Desc = $tbl.find("textarea.m_Desc").val();
			
			$("#m_Info").ajaxNet(
			"/manager/recruit/recruitMethod.aspx?_vb=Modify"
			,
			{
				"RecruitNo" : data.RecruitNo
			,	"Status" : Status
			,	"Description" : Desc
			}, function(results, context)
			{
				$.Recruit.GetList();
				alert( "변경되었습니다.");
			});
		}
	}
	
	$(function() {
		$.Recruit.Init();
	});
})(jQuery);
</script>

</asp:Content>
